#include "mygraphicsview.h"
#include <QMouseEvent>

MyGraphicsView::MyGraphicsView(QWidget *parent) : QGraphicsView(parent)
{

}

void MyGraphicsView::mousePressEvent(QMouseEvent *event)
{
    // 鼠标点击事件
    if(event->button() == Qt::LeftButton)
    {
        QPoint point = event->pos();
        emit mouseClickedSignal(point);
    }
    // 将控制权归还给基类
    QGraphicsView::mousePressEvent(event);
}

void MyGraphicsView::mouseMoveEvent(QMouseEvent *event)
{
    QPoint point = event->pos();
    emit mouseMovePointSignal(point);
    QGraphicsView::mouseMoveEvent(event);
}


